package com.jcfk.eam.controller.board;

import com.jcfk.common.web.domain.RetResult;
import com.jcfk.eam.domain.query.board.MouldMaintenanceTaskQuery;
import com.jcfk.eam.domain.query.board.MouldProductionTaskQuery;
import com.jcfk.eam.domain.query.board.MouldStatusBoardQuery;
import com.jcfk.eam.service.board.MoldTaskBoardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "摸具看板")
@RestController()
@RequestMapping("board")
public class MoldTaskBoardController {
    @Autowired
    private MoldTaskBoardService moldTaskBoardService;

    @ApiOperation("模具生产任务看板")
    @PostMapping("/productionTask")
    public RetResult<?> productionTask(MouldProductionTaskQuery query) {
        return RetResult.ok(moldTaskBoardService.productionTask(query));

    }

    @ApiOperation("模具维修任务看板")
    @PostMapping("/maintenanceTask")
    public RetResult<?> maintenanceTask(@RequestBody MouldMaintenanceTaskQuery query) {
        return RetResult.ok(moldTaskBoardService.maintenanceTask(query));
    }

    @ApiOperation("模具状态看板")
    @PostMapping("/mouldStatus")
    public RetResult<?> mouldStatus(@RequestBody MouldStatusBoardQuery query) {
        return RetResult.ok(moldTaskBoardService.mouldStatus(query));
    }
}
